package com.qf.sql;

import org.apache.ibatis.jdbc.SQL;

import java.util.Map;

public class SqlProvider {

    public String findByIdAnnotation(Map<String,Object> params){
        Integer id = (Integer) params.get("id");

        return new SQL(){
            {
                SELECT("*");
                FROM("user");
                if(id != null){
                    WHERE("id = #{id}");
                }
            }
        }.toString();

    }

}
